import java.util.Scanner;

public class Testclass
{
	// private static String name;
	// private static String surname;
	// private static int bancAccount;
	// private static int matrikelNr;
	// private static int persNr;
	private static String[] name = {"Hofsäss","Grundl","Albrecht","Herbert","Zange","Stieler","Lezin","Koch","Hack","Hasse"};
	private static  String[] surname = {"Florian","Florian","Tobias","Gabriel","Ronny","Fabian","Michael","Patrick","Patrick","Jan Hendrik"};
	private static int bancAccount = 123;
	private static int matrikelNr = 456;
	private static String name2;
	private static String surname2;
	private static int persNr;
	private static FomStudent[] students = new FomStudent[20];
	private static FomEmploye[] employes = new FomEmploye[20];
	private static Kurs[] course = new Kurs[20];
	private static int anzahl;
	private static String titel;
	
	public static void main(String[] args)
	{
		Scanner eingabe = new Scanner(System.in);
		
		int enter=5;
		do{
			System.out.println("Press a Key an chose:");
			System.out.println("1: Add Student");
			System.out.println("2: Add Employe");
			System.out.println("3: Add Course");
			System.out.println("4: Print Course");
			
			enter = eingabe.nextInt();
			if(enter == 1)
				addStudent();
			else if(enter == 2)
				addEmploye();
			else if(enter == 3)
			{	
				addCourse(0);
				addCourse(1);
			}
			else if(enter ==4)
			{
				printCourse();
			}
			else
				System.out.println("Something went wrong");
			}while(enter!=0);
	}
		
		
	
	
	public static void addStudent()
	{
		Scanner eingabe = new Scanner(System.in);
		System.out.println("Wieviele Students wollt ihr eingeben?");
		anzahl = eingabe.nextInt();
		int i;
		
		for(i=0;i<anzahl;i++)
		{
			// System.out.println("Name:");
			// name = eingabe.next();
			// System.out.println("Surname:");
			// surname = eingabe.next();
			// System.out.println("MartikelNumber:");
			// matrikelNr = eingabe.nextInt();
			// System.out.println("Banc Account Number:");
			// bancAccount = eingabe.nextInt();
			// students[i] = new FomStudent (name,surname,matrikelNr,bancAccount);
			students[i] = new FomStudent (name[i],surname[i],matrikelNr,bancAccount);
		}
	}
	
	public static void addEmploye()
	{
		Scanner eingabe = new Scanner(System.in);
		System.out.println("Wieviele Mitarbeiter wollt ihr erfassen?");
		anzahl = eingabe.nextInt();
		int i;
		
		for(i=0;i<anzahl;i++)
		{
			System.out.println("Name:");
			name2 = eingabe.next();
			System.out.println("Surname:");
			surname2 = eingabe.next();
			System.out.println("PersonalNr:");
			persNr = eingabe.nextInt();
			
			employes[i] = new FomEmploye(name2,surname2,persNr);
		}
	}
	
	public static void addCourse(int h)
	{
		Scanner eingabe = new Scanner(System.in);
		
		System.out.println("Bitte geben Sie den Titel des Kurses ein!");
		titel = eingabe.next();
		System.out.println("Welchen Dozenten wollen Sie wählen?");
		int i=0;
		int tmpd,tmpst;
		
		if(employes[0] == null)
		{
			System.out.println("Es wurden noch keine Dozenten angelegt!");
		}
		else
		{
			while(employes[i] != null)
			{
				System.out.println(i+": "+employes[i].getName()+","+employes[i].getSurname());
				i++;
			}
		}
		
		tmpd = eingabe.nextInt();
		
		course[h] = new Kurs(titel,employes[tmpd],5,students[(h*5)],students[(h*5)+1],students[(h*5)+2],students[(h*5)+3],students[(h*5)+4]);
	}
	public static void printCourse()
	{
		int i;
		for(i=0;course[i] != null ; i++)
		{
			course[i].print();
		}
	}
		
	
	
	public static void printCourse(int i)
	{
		course[i].print();
	}
}